import 'dart:ffi';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

import 'package:fluwx/fluwx.dart';

import 'package:magic_car/util/HttpHelper.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:toast/toast.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:magic_car/UI/bottom_Menu_page.dart';
import 'package:magic_car/UI/userbottom_Menu_page.dart';

class UserPravite extends StatefulWidget {
  final String url;
  
  UserPravite(this.url);
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return new web_page_state(this.url);
  }
}

class web_page_state extends State<UserPravite> {
 
  String _url; //https://mp.weixin.qq.com/s/i52AMqVSNr7_Wv5suYq9Ig
  
  web_page_state(this._url);
  

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
   
  }

  
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text(
          "用户隐私政策",
          style: new TextStyle(color: Colors.black),
        ),
        backgroundColor: Colors.white,
        elevation: 0,
        iconTheme: new IconThemeData(color: Colors.black),
      ),
      // floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
      // floatingActionButton: FloatingActionButton(
      //   onPressed: () {
      //     backhome();
      //   },
      //   child: Icon(
      //     Icons.home,
      //     color: Colors.white,
      //   ),
      //   backgroundColor: Color.fromRGBO(27, 182, 251, 1),
      // ),
      body: new Center(
          child: Container(
              decoration: new BoxDecoration(
                color: Color.fromRGBO(238, 238, 238, 1),
              ),
              child: Stack(children: <Widget>[
                Align(
                    alignment: Alignment.topCenter,
                    child: WebView(
                      initialUrl: this._url,
                      // javascriptMode: JavascriptMode.unrestricted, // 使用JS没限制
                    )),
              
              ]))),
    );
  }

 
}